package com.scanner.hardware.adapter;

import android.support.annotation.Nullable;

import com.scanner.bean.MotoBarcode;
import com.scanner.hardware.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class MotoSigAdapter extends BaseQuickAdapter<MotoBarcode,BaseViewHolder> {
    public MotoSigAdapter(int layoutResId, @Nullable List<MotoBarcode> data) {
        super(layoutResId, data);

    }

    @Override
    protected void convert(BaseViewHolder helper, MotoBarcode item) {
        helper.setText(R.id.tv_sigName,item.getCodeName());
        int codeState = item.getCodeState();
        if(codeState == 1){
            helper.setChecked(R.id.cb_choose,true);
        }else if(codeState == 0){
            helper.setChecked(R.id.cb_choose,false);
        }
    }
}
